Skip to content

Conversation

@maxisbey
Copy link
Contributor

@maxisbey maxisbey commented Oct 30, 2025

Motivation and Context

This adds 100% coverage by adding # pragma: no cover in a bunch of places.

This is taking over the work from #1354

Currently this PR is set to draft as it's the initial run of doing this for the whole repo. Need to get some eyes on this to make sure we're doing this right.

TODO:

  • Check over this to make sure we're adding no cover in the correct way
  • Ensure the CI is set up to correctly handle
  • Make sure there no # pragma: no cover's added where they shouldn't be, like if the line is actually covered I would want these removed.

How Has This Been Tested?

Breaking Changes

Hopefully nothing

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@maxisbey maxisbey marked this pull request as draft October 30, 2025 22:51
@maxisbey maxisbey requested a review from Kludex October 30, 2025 23:15
@maxisbey maxisbey marked this pull request as ready for review November 10, 2025 17:44
@maxisbey maxisbey force-pushed the coverage-setup branch 2 times, most recently from d148a88 to 9577775 Compare November 10, 2025 18:39
@maxisbey maxisbey enabled auto-merge (squash) November 10, 2025 22:14
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer for this to be called test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

try:
config_file.write_text("{}")
except Exception:
except Exception: # pragma: no cover
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one above covers this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

async def get_tokens(self) -> OAuthToken | None:
"""Get stored tokens."""
...
... # pragma: no cover
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can add ... on the ignore rule in the pyproject.toml?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

pyproject.toml Outdated
Comment on lines 194 to 196
exclude_also = [
'\A(?s:.*# pragma: exclude file.*)\Z'
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer if we avoid this, it seems too easy...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Copy link
Member

@Kludex Kludex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maxisbey maxisbey merged commit 89e9c43 into main Nov 11, 2025
21 checks passed
@maxisbey maxisbey deleted the coverage-setup branch November 11, 2025 13:09
maxisbey added a commit that referenced this pull request Nov 11, 2025
Adds commit 89e9c43 to
.git-blame-ignore-revs to exclude the large-scale addition of
# pragma: no cover comments from git blame output.

This commit established a 100% code coverage baseline by adding pragma
comments throughout the codebase. While important for coverage tracking,
these annotations are noise in git blame and should be ignored to show
the original authors of substantive code changes.

Github-Issue: #1553
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants